INPUT_GET
INPUT_GET = 1
Utility class providing common functions
explode(string $separator, string $string) : array
A wrapper for PHP's explode() that does not throw a warning when the separator does not exist in the string
string | $separator | Separator string |
string | $string | The string to explode |
Exploded string. Still an array if there's no separator in the string
rep_specialchars_output(string $str, string $enctype = '', string $mode = '', bool $newlines = true) : string
Replacing specials characters to a specific encoding type
string | $str | Input string |
string | $enctype | Encoding type: text|html|xml|js|url |
string | $mode | Replace mode for tags: show|remove|strict |
bool | $newlines | Convert newlines |
The quoted string
get_input_string(string $fname, int $source, bool $allow_html = false, string $charset = null) : string
Read input value and make sure it is a string.
string | $fname | Field name to read |
int | $source | Source to get value from (see self::INPUT_*) |
bool | $allow_html | Allow HTML tags in field value |
string | $charset | Charset to convert into |
Request parameter value
get_input_value(string $fname, int $source, bool $allow_html = false, string $charset = null) : string|array|null
Read request parameter value and convert it for internal use Performs stripslashes() and charset conversion if necessary
string | $fname | Field name to read |
int | $source | Source to get value from (see self::INPUT_*) |
bool | $allow_html | Allow HTML tags in field value |
string | $charset | Charset to convert into |
Request parameter value or NULL if not set
parse_input_value(string $value, bool $allow_html = false, string $charset = null) : string
Parse/validate input value. See self::get_input_value() Performs stripslashes() and charset conversion if necessary
string | $value | Input value |
bool | $allow_html | Allow HTML tags in field value |
string | $charset | Charset to convert into |
Parsed value
request2param(int $mode = null, string $ignore = 'task|action', bool $allow_html = false) : array
Convert array of request parameters (prefixed with _) to a regular array with non-prefixed keys.
int | $mode | Source to get value from (GPC) |
string | $ignore | PCRE expression to skip parameters by name |
bool | $allow_html | Allow HTML tags in field value |
Hash array with all request parameters
mod_css_styles(string $source, string $container_id, bool $allow_remote = false, string $prefix = '') : string
Replace all css definitions with #container [def] and remove css-inlined scripting, make position style safe
string | $source | CSS source code |
string | $container_id | Container ID to use as prefix |
bool | $allow_remote | Allow remote content |
string | $prefix | Prefix to be added to id/class identifier |
Modified CSS source
server_name(string $type = null, bool $strip_port = true) : string
Returns the server name after checking it against trusted hostname patterns.
Returns 'localhost' and logs a warning when the hostname is not trusted.
string | $type | The $_SERVER key, e.g. 'HTTP_HOST', Default: 'SERVER_NAME'. |
bool | $strip_port | Strip port from the host name |
Server name
anytodatetime(string $date, \DateTimeZone $timezone = null) : \DateTime|false
Date parsing function that turns the given value into a DateTime object
string | $date | Date string |
\DateTimeZone | $timezone | Timezone to use for DateTime object |
DateTime object or False on failure
format_datestr(string $date, string $format) : string
Turns the given date-only string in defined format into YYYY-MM-DD format.
Supported formats: 'Y/m/d', 'Y.m.d', 'd-m-Y', 'd/m/Y', 'd.m.Y', 'j.n.Y'
string | $date | Date string |
string | $format | Input date format |
Date string in YYYY-MM-DD format, or the original string if format is not supported
normalize_string(string $str, bool $as_array = false, int $minlen = 2) : string|array
Normalize the given string for fulltext search.
Currently only optimized for ISO-8859-1 and ISO-8859-2 characters; to be extended
string | $str | Input string (UTF-8) |
bool | $as_array | True to return list of words as array |
int | $minlen | Minimum length of tokens |
Normalized string or a list of normalized tokens
date_format(string $format = null) : string
Format current date according to specified format.
This method supports microseconds (u).
string | $format | Date format (default: 'd-M-Y H:i:s O') |
Formatted date
None found |
parse_socket_options(array $options, string $host = null) : mixed
Parses socket options and returns options for specified hostname.
array | $options | Configured socket options |
string | $host | Hostname |
None found |
max_upload_size() : int
Get maximum upload size
Maximum size in bytes
None found |
preg_error(array $error = [], bool $terminate = false) : bool
Detect and log last PREG operation error
array | $error | Error data (line, file, code, message) |
bool | $terminate | Stop script execution |
True on error, False otherwise
None found |
temp_filename(string $file_name, bool $unique = true, bool $create = true) : string
Generate a temporary file path in the Roundcube temp directory
string | $file_name | String identifier for the type of temp file |
bool | $unique | Generate unique file names based on $file_name |
bool | $create | Create the temp file or not |
temporary file path
None found |
remove_subject_prefix(string $subject, string $mode = 'both') : string
Clean the subject from reply and forward prefix
string | $subject | Subject to clean |
string | $mode | Mode of cleaning : reply, forward or both |
Cleaned subject
None found |